
//#include <stdio.h>

#include <iostream>
#include "rtmp_pusher.h"
#include "http_server.h"
#include "tmprtmp.h"
#include "tmp.hpp"
#include "python_caller.h"
#include "onnx_caller.h"

using namespace std;

int video_stream()
{
    printf("RtmpPusher--------------\n");
    RtmpPusher* pusher = RtmpPusher::GetInstance();
    pusher->Init("rtmp://127.0.0.1/live/stream");
    pusher->Start();
    return 0;
}

#include <opencv2/opencv.hpp>

int main()
{
    OnnxCaller *pOnnxCaller = OnnxCaller::getInstance();
    // TmpRtmpStreamTest rtmpStreamTest;
    // rtmpStreamTest.Start();

    cout << "main" << endl;
    rtmp_stream_test();

    HttpServer server(8080);
    server.Start();

    // cv::Mat img = cv::imread("/home/marvsmart/workspace/shoe_keypoint_infer/test/test_frame_000039.PNG");
    // double res[4] = {0};
    // PythonCaller *pPythonCaller = PythonCaller::getInstance();
    // pPythonCaller->ProcessImage(img, res);
    // std::cout << res[0] << res[1] << res[2] << res[3] << std::endl;

    // cv::Mat img1 = cv::imread("/home/marvsmart/workspace/shoe_keypoint_infer/test/test_frame_000039.PNG");
    // OnnxCaller *pOnnxCaller = OnnxCaller::getInstance();
    // pOnnxCaller->ProcessImage(img1);
    // cv::imwrite("r1.jpg", img1);
    // cv::Mat img2 = cv::imread("/home/marvsmart/workspace/shoe_keypoint_infer/test/11.png");
    // pOnnxCaller->ProcessImage(img2);
    // cv::imwrite("r2.jpg", img2);

    getchar();
    
    return 0;
}